﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Pot3a10
    {
		private string _productname;
        private int? _productcode;
		private string _pid;
		private string _barcode;
        private int? _qty;
		private string _listid;
		
        /// <summary>
        /// 商品名称
        /// </summary>
		public string Productname
		{
			get { return _productname;	 }
			set { _productname=value;	}
		}
        /// <summary>
        /// 商品代码
        /// </summary>
		public int? Productcode
		{
			get { return _productcode;	 }
			set { _productcode=value;	}
		}
        /// <summary>
        /// 商品标识
        /// </summary>
		public string Pid
		{
			get { return _pid;	 }
			set { _pid=value;	}
		}
        /// <summary>
        /// 条码
        /// </summary>
		public string Barcode
		{
			get { return _barcode;	 }
			set { _barcode=value;	}
		}
        /// <summary>
        /// 数量
        /// </summary>
		public int? Qty
		{
			get { return _qty;	 }
			set { _qty=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Pot3a10> GetPot3a10ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Pot3a10> list = new List<Pot3a10>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Pot3a10 model = GetPot3a10ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Pot3a10 GetPot3a10ByDataRow(DataRow dr)
		{
			Pot3a10 model = new Pot3a10(); //实例化Pot3a10
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("productname")&&!(dr["productname"] is System.DBNull))  
				model.Productname = ( string)dr["productname"];
			if (dcc.Contains("productcode")&&!(dr["productcode"] is System.DBNull))  
				model.Productcode = ( int)dr["productcode"];
			if (dcc.Contains("pid")&&!(dr["pid"] is System.DBNull))  
				model.Pid = ( string)dr["pid"];
			if (dcc.Contains("barcode")&&!(dr["barcode"] is System.DBNull))  
				model.Barcode = ( string)dr["barcode"];
			if (dcc.Contains("qty")&&!(dr["qty"] is System.DBNull))  
				model.Qty = ( int)dr["qty"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
